﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Xmpp: TestOpenClose02.fsmcs Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                C# examples using state machines generated by StateBuilderDotNet
            </h1>
            <h3>
                Xmpp: TestOpenClose02.fsmcs Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">TestOpenClose02.fsmcs</div>  </div>
</div>
<div class="contents">
<a href="_test_open_close02_8fsmcs.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
<a name="l00002"></a>00002 &lt;sm:StateMachine xmlns:sm=<span class="stringliteral">&quot;http://www.stateforge.com/StateMachineDotNet-v1&quot;</span>
<a name="l00003"></a>00003                  xmlns:xsi=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>
<a name="l00004"></a>00004                  xsi:schemaLocation=<span class="stringliteral">&quot;http://www.stateforge.com/StateMachineDotNet-v1</span>
<a name="l00005"></a>00005 <span class="stringliteral">                                     http://www.stateforge.com/xsd/StateMachineDotNet-v1.xsd&quot;</span> &gt;
<a name="l00006"></a>00006     &lt;!-- general settings --&gt;
<a name="l00007"></a>00007     &lt;settings asynchronous=<span class="stringliteral">&quot;true&quot;</span> <span class="keyword">namespace</span>=<span class="stringliteral">&quot;StateForge.Examples.XmppChat&quot;</span>&gt;
<a name="l00008"></a>00008         &lt;<span class="keywordtype">object</span> instance=<span class="stringliteral">&quot;chatScenario&quot;</span> <span class="keyword">class</span>=<span class="stringliteral">&quot;ChatScenario&quot;</span>/&gt;
<a name="l00009"></a>00009         &lt;<span class="keywordtype">object</span> instance=<span class="stringliteral">&quot;alice&quot;</span> <span class="keyword">class</span>=<span class="stringliteral">&quot;Client&quot;</span>/&gt;
<a name="l00010"></a>00010         &lt;<span class="keywordtype">object</span> instance=<span class="stringliteral">&quot;bob&quot;</span> <span class="keyword">class</span>=<span class="stringliteral">&quot;Client&quot;</span>/&gt;
<a name="l00011"></a>00011     &lt;/settings&gt;
<a name="l00012"></a>00012 
<a name="l00013"></a>00013     &lt;!-- events --&gt;
<a name="l00014"></a>00014     &lt;events&gt;
<a name="l00015"></a>00015         &lt;eventSource name=<span class="stringliteral">&quot;IChatScenario&quot;</span> file=<span class="stringliteral">&quot;IChatScenario.cs&quot;</span>/&gt;
<a name="l00016"></a>00016         &lt;eventSource name=<span class="stringliteral">&quot;Timer&quot;</span>&gt;
<a name="l00017"></a>00017             &lt;timer <span class="keywordtype">id</span>=<span class="stringliteral">&quot;EvTimerMaxDuration&quot;</span> name=<span class="stringliteral">&quot;TimerMaxDuration&quot;</span>/&gt;
<a name="l00018"></a>00018         &lt;/eventSource&gt;
<a name="l00019"></a>00019     &lt;/events&gt;
<a name="l00020"></a>00020 
<a name="l00021"></a>00021     &lt;!-- States --&gt;
<a name="l00022"></a>00022     &lt;state name=<span class="stringliteral">&quot;Root&quot;</span>&gt;
<a name="l00023"></a>00023         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;EvTimerMaxDuration&quot;</span> nextState=<span class="stringliteral">&quot;End&quot;</span>&gt;
<a name="l00024"></a>00024             &lt;action&gt;chatScenario.Error = <span class="stringliteral">&quot;Maximum duration expired&quot;</span>&lt;/action&gt;
<a name="l00025"></a>00025         &lt;/transition&gt;
<a name="l00026"></a>00026         &lt;!-- State Idle --&gt;
<a name="l00027"></a>00027         &lt;state name=<span class="stringliteral">&quot;Idle&quot;</span>&gt;
<a name="l00028"></a>00028             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;Start&quot;</span> nextState=<span class="stringliteral">&quot;Login&quot;</span>&gt;
<a name="l00029"></a>00029                 &lt;timerStart timer=<span class="stringliteral">&quot;TimerMaxDuration&quot;</span> duration=<span class="stringliteral">&quot;chatScenario.MaxDuration&quot;</span>/&gt;
<a name="l00030"></a>00030             &lt;/transition&gt;
<a name="l00031"></a>00031         &lt;/state&gt;
<a name="l00032"></a>00032         
<a name="l00033"></a>00033         &lt;!-- State Login --&gt;
<a name="l00034"></a>00034         &lt;state name=<span class="stringliteral">&quot;Login&quot;</span>&gt;
<a name="l00035"></a>00035             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;Closed&quot;</span> nextState=<span class="stringliteral">&quot;End&quot;</span>&gt;
<a name="l00036"></a>00036                 &lt;action&gt;chatScenario.Error = <span class="stringliteral">&quot;Event closed has been received&quot;</span>&lt;/action&gt;
<a name="l00037"></a>00037             &lt;/transition&gt;
<a name="l00038"></a>00038             &lt;parallel nextState=<span class="stringliteral">&quot;Closing&quot;</span>&gt;
<a name="l00039"></a>00039                 &lt;!-- Machine Alice --&gt;
<a name="l00040"></a>00040                 &lt;state name=<span class="stringliteral">&quot;AliceLogin&quot;</span>&gt;
<a name="l00041"></a>00041                     &lt;!-- State Alice_Login --&gt;
<a name="l00042"></a>00042                     &lt;state name=<span class="stringliteral">&quot;Alice_Login&quot;</span> description=<span class="stringliteral">&quot;Alice logins&quot;</span>&gt;
<a name="l00043"></a>00043                         &lt;onEntry action=<span class="stringliteral">&quot;alice.Open()&quot;</span>/&gt;
<a name="l00044"></a>00044                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;LoggedIn&quot;</span> condition=<span class="stringliteral">&quot;jid.User == alice.Jid.User&quot;</span> nextState=<span class="stringliteral">&quot;Alice_Login_End&quot;</span>/&gt;
<a name="l00045"></a>00045                     &lt;/state&gt;
<a name="l00046"></a>00046                     &lt;!-- State Alice_Login_End --&gt;
<a name="l00047"></a>00047                     &lt;state name=<span class="stringliteral">&quot;Alice_Login_End&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00048"></a>00048                 &lt;/state&gt;
<a name="l00049"></a>00049 
<a name="l00050"></a>00050                 &lt;!-- Machine Bob --&gt;
<a name="l00051"></a>00051                 &lt;state name=<span class="stringliteral">&quot;BobLogin&quot;</span>&gt;
<a name="l00052"></a>00052                     &lt;!-- State Bob_Login --&gt;
<a name="l00053"></a>00053                     &lt;state name=<span class="stringliteral">&quot;Bob_Login&quot;</span> description=<span class="stringliteral">&quot;Bob logins&quot;</span>&gt;
<a name="l00054"></a>00054                         &lt;onEntry action=<span class="stringliteral">&quot;bob.Open()&quot;</span>/&gt;
<a name="l00055"></a>00055                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;LoggedIn&quot;</span> condition=<span class="stringliteral">&quot;jid.User == bob.Jid.User&quot;</span> nextState=<span class="stringliteral">&quot;Bob_Login_End&quot;</span>/&gt;
<a name="l00056"></a>00056                     &lt;/state&gt;
<a name="l00057"></a>00057                     &lt;!-- State Bob_Login_End --&gt;
<a name="l00058"></a>00058                     &lt;state name=<span class="stringliteral">&quot;Bob_Login_End&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00059"></a>00059                 &lt;/state&gt;
<a name="l00060"></a>00060             &lt;/parallel&gt;
<a name="l00061"></a>00061         &lt;/state&gt;
<a name="l00062"></a>00062         &lt;!-- State Closing --&gt;
<a name="l00063"></a>00063         &lt;state name=<span class="stringliteral">&quot;Closing&quot;</span>&gt;
<a name="l00064"></a>00064             &lt;parallel nextState=<span class="stringliteral">&quot;End&quot;</span>&gt;
<a name="l00065"></a>00065                 &lt;!-- Machine AliceClosing --&gt;
<a name="l00066"></a>00066                 &lt;state name=<span class="stringliteral">&quot;AliceClosing&quot;</span>&gt;
<a name="l00067"></a>00067                     &lt;!-- State Alice_Closing --&gt;
<a name="l00068"></a>00068                     &lt;state name=<span class="stringliteral">&quot;Alice_Closing&quot;</span> description=<span class="stringliteral">&quot;Alice is closing&quot;</span>&gt;
<a name="l00069"></a>00069                         &lt;onEntry action=<span class="stringliteral">&quot;alice.Close()&quot;</span>/&gt;
<a name="l00070"></a>00070                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;Closed&quot;</span> condition=<span class="stringliteral">&quot;jid.User == alice.Jid.User&quot;</span> nextState=<span class="stringliteral">&quot;Alice_Closing_End&quot;</span>/&gt;
<a name="l00071"></a>00071                     &lt;/state&gt;
<a name="l00072"></a>00072                     &lt;!-- State Alice_Closing_End --&gt;
<a name="l00073"></a>00073                     &lt;state name=<span class="stringliteral">&quot;Alice_Closing_End&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00074"></a>00074                 &lt;/state&gt;
<a name="l00075"></a>00075 
<a name="l00076"></a>00076                 &lt;!-- Machine Bob --&gt;
<a name="l00077"></a>00077                 &lt;state name=<span class="stringliteral">&quot;BobClosing&quot;</span>&gt;
<a name="l00078"></a>00078                     &lt;!-- State Bob_Closing --&gt;
<a name="l00079"></a>00079                     &lt;state name=<span class="stringliteral">&quot;Bob_Closing&quot;</span> description=<span class="stringliteral">&quot;Bob is closing&quot;</span>&gt;
<a name="l00080"></a>00080                         &lt;onEntry action=<span class="stringliteral">&quot;bob.Close()&quot;</span>/&gt;
<a name="l00081"></a>00081                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;Closed&quot;</span> condition=<span class="stringliteral">&quot;jid.User == bob.Jid.User&quot;</span> nextState=<span class="stringliteral">&quot;Bob_Closing_End&quot;</span>/&gt;
<a name="l00082"></a>00082                     &lt;/state&gt;
<a name="l00083"></a>00083                     &lt;!-- State Bob_Closing_End --&gt;
<a name="l00084"></a>00084                     &lt;state name=<span class="stringliteral">&quot;Bob_Closing_End&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00085"></a>00085                 &lt;/state&gt;
<a name="l00086"></a>00086             &lt;/parallel&gt;
<a name="l00087"></a>00087         &lt;/state&gt;        
<a name="l00088"></a>00088         &lt;state name=<span class="stringliteral">&quot;End&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00089"></a>00089     &lt;/state&gt;
<a name="l00090"></a>00090 &lt;/sm:StateMachine&gt;
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
